package com.wgo.surveyModel.domain.common.impl;

import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Set;
import java.util.Date;

import java.util.Set;

import com.wgo.surveyModel.domain.common.*;

public class VesselImpl extends EquipmentImpl implements Vessel
{
	private String name;
	private Float weight;
	private Set<Streamer> streamers;
	private SurveyDef surveydef;

	public VesselImpl(){
		super();
		streamers = new HashSet<Streamer>();
   
	}
	public Set<Streamer> getStreamers ()
	{
		return streamers;
	}
  
	public void setStreamers(Set<Streamer> streamers)
	{
		this.streamers = streamers;
			
	}
	
  
	public boolean addStreamer(Streamer streamer)
	{
	    if (!streamers.contains(streamer))
	    {
			this.streamers.add(streamer);   
		    if( this != streamer.getVessel())
		    {
		      streamer.setVessel(this);
		    }		  
		    
		}
		
		return true; 
	}
  
	public boolean removeStreamer(Streamer streamer)
	{
		this.streamers.remove(streamer); 
			((StreamerImpl)streamer).setVessel(null);
			
		
		return true;	
	}
	
	public SurveyDef getSurveydef ()
	{
		return surveydef;
	}

	public void setSurveydef(SurveyDef surveydef)
	{	
	     if( null != surveydef)
	     { 	
		    this.surveydef = surveydef;
         	
		   //surveydef.addVessel(this);
		 }
		 else if( null != this.surveydef)
		 {
		    this.surveydef.removeVessel(this);	
		    this.surveydef = null;		      
		 }
		     	
	}

	public String getName ()
	{
		return name;
	}

	public void setName(String name)
	{	  	
		this.name = name;		
	}

	public Float getWeight ()
	{
		return weight;
	}

	public void setWeight(Float weight)
	{	  	
		this.weight = weight;		
	}

}
